/*
 * Copyright (C) 2025 Tsingteng MicroSystem
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef _NFC_TRANSPORT_API_H_
#define _NFC_TRANSPORT_API_H_

#include "stdbool.h"
#include "nfc_types.h"
#include "nfc_config_api.h"

#define CAP_HOST_ALLOW_LIST    4
#define CAP_OFFHOST_ROUTE_UICC 4
#define CAP_OFFHOST_ROUTE_ESE  4

typedef enum {
    NFC_CLOSE_TYPE_DISABLE = 0,
    NFC_CLOSE_TYPE_HOST_SWITCHED_OFF,
} tNFC_CLOSE_TYPE;

typedef enum {
    NFC_EVT_OPEN_CPLT = 0,
    NFC_EVT_CLOSE_CPLT,
    NFC_EVT_POST_INIT_CPLT,
    NFC_EVT_PRE_DISCOVER_CPLT,
    NFC_EVT_HCI_NETWORK_RESET,
    NFC_EVT_ERROR,
} tNFC_EVENT;

typedef void(*tNFC_DATA_CALLBACK)(uint16_t data_len, uint8_t* data);
typedef void(*tNFC_EVENT_CALLBACK)(tNFC_EVENT, tNFC_STATUS);

#ifdef __cplusplus
extern "C" {
#endif
tNFC_STATUS tp_open(tNFC_EVENT_CALLBACK event_cb, tNFC_DATA_CALLBACK data_cb);
tNFC_STATUS tp_close(tNFC_CLOSE_TYPE type);
tNFC_STATUS tp_core_init();
tNFC_STATUS tp_factory_reset();
tNFC_STATUS tp_check_firmware();
tNFC_STATUS tp_get_config(void *data);
tNFC_STATUS tp_power_cycle();
tNFC_STATUS tp_pre_discovery();
tNFC_STATUS tp_write(const uint8_t* data, uint16_t data_len);
tNFC_STATUS tp_set_transit_config(const char* value);
tNFC_STATUS tp_is_config_modified();
#ifdef __cplusplus
};
#endif

#endif /* _NFC_TRANSPORT_API_H_ */
